package worldinruin.core;

import java.beans.PropertyChangeListener;
import java.util.List;

import worldinruin.utils.IObservable;

public interface ITile extends IObservable {

	/**
	 * Gets index for row placement.
	 * @return Row index.
	 */
	int getRow();
	
	/**
	 * Gets index for column placement.
	 * @return Column index.
	 */
	int getColumn();
	
	/**
	 * Gets the tile's type.
	 * @return The tiletype of tile.
	 */
	IType getTileType();
	
	/**
	 * Gets the title string on the tile.
	 * @return Title string.
	 */
	String getTileHead();
	
	/**
	 * Creates a new tile on the row or column.
	 * @param row Row index.
	 * @param column Column index.
	 * @return New tile object on the row and column.
	 */
	ITile newInstance(int row, int column);

	/**
	 * Returns the building, if any, on the current tile
	 * @return Building on the tile.
	 */
	IBuilding getBuilding();
	
	/**
	 * Gets the description for the tile.
	 * @return A string of the description for the tile.
	 */
	String getDescription();
	
	/**
	 * Adds a building to the tile.
	 * @param b Bulding added to tile.
	 */
	void addBuilding(IBuilding b);
	
	/**
	 * Removes the building, if any, from the tile.
	 * @param b Building to remove from tile.
	 */
	void removeBuilding(IBuilding b);

	/**
	 * Gets all troops on the tile, if any troops.
	 * @return List of all troops currently on the tile.
	 */
	List<ITroop> getTroops();
	
	/**
	 * Adds a troop to the tile.
	 * @param t Troop to add to tile.
	 */
	void addTroop(ITroop t);
	
	/**
	 * Removes the specified troop from the tile.
	 * @param t Troop to be removed from tile.
	 */
	void removeTroop(ITroop t);
	
	/**
	 * Adds a proertychangelistener.
	 */
	void addPropertyChangeListener(PropertyChangeListener pcl);
	
	/**
	 * Removes a propertychangelistener.
	 */
	void removePropertyChangeListener(PropertyChangeListener pcl);

	/**
	 * Gets a list of all buildings that can be built on the specified tile.
	 * @return List of buildings.
	 */
	List<IBuilding> getAvailableBuildings();
	
	/**
	 * Gets the name of the tile.
	 * @return A string of the tile name.
	 */
	String getName();
	
}
